/**
 * Created by Administrator on 14-3-20.
 */

var robot= function( ){
    this.state;
    /*this.goahead ;
    this.turn;
    this.attack;
    this.state;//保持玩家的当前信息
    使用方法：
    *  var scratch = Physics.scratchpad();
       var d = scratch.vector();
        d.clone（this.state.pos）//获取坐标
        d.clone（this.state.angular）//获取角度信息
        d.clone（this.state.acc）//获取加速度
        d.get(0);d.get(1);//对应于（x,y）
     scratch.done();//结束
    *
     *  */
    var  count=0;
    function myrun() {//hehe

        // console.log(this);
        this.goahead(100);
        this.turn(1);
        var scratch = Physics.scratchpad();
        var d = scratch.vector();
        var x,y;
        var mes=document.getElementById('message');

        // get the displacement of the body from the ship and scale it
        d.clone( this.state.pos );
        // color the dot based on how massive the body is
        x= d.get(0);y= d.get(1);
        mes.innerHTML='x:'+x+'<br/>y:'+y;
        scratch.done();
    }
}


/*
 function myrun() {
 mes.begin();
 var coor=mes.getPosition('player');
 var mes1=document.getElementById('message');
 mes1.innerHTML='x:'+coor.x+'<br/>y:'+coor.y;
 mes.end();}
 */

